import { defineStore } from 'pinia';

import { api, Fleet } from '@/api';


export const useFleetStore = defineStore('fleet', {
	state: () => {
		return {
			fleet: {
				icebreakers: [],
				transport_ships: []
			} as Fleet
		};
	},
	actions: {
		init() {
			api.getFleet().then(response => {
				this.fleet = response.fleet;
			});
		}
	}
});